Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@alwatr/local-storage
Advanced tools
`localJsonStorage` is a utility object in our TypeScript package that provides methods for interacting with the local storage in a structured and versioned manner.
localJsonStorage
is a utility object in our TypeScript package that provides methods for interacting with the local storage in a structured and versioned manner.
Before you can use localJsonStorage
, you need to install the package. If you're using npm, you can do this with:
npm install @alwatr/local-storage
If you're using Yarn, you can do this with:
yarn add @alwatr/local-storage
First, you need to import localJsonStorage
from the package:
import {localJsonStorage} from '@alwatr/local-storage';
Or for CommonJS:
const {localJsonStorage} = require('@alwatr/local-storage');
You can get an item from local storage and parse it as JSON using the getItem
method. If the item is not found, it will return a default value:
const defaultValue = {a: 1, b: 2};
const value = localJsonStorage.getItem('item-name', defaultValue);
You can set an item in local storage as JSON using the setItem
method:
const value = {a: 1, b: 2};
localJsonStorage.setItem('item-name', value);
You can remove an item from local storage using the removeItem
method:
localJsonStorage.removeItem('item-name');
We plan to add more methods to localJsonStorage
for directly interacting with local storage. Stay tuned for updates!
The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
Contributions are welcome! Please read our contribution guidelines before submitting a pull request.
This project is licensed under the AGPL-3.0 License.
FAQs
`localJsonStorage` is a utility object in our TypeScript package that provides methods for interacting with the local storage in a structured and versioned manner.
The npm package @alwatr/local-storage receives a total of 89 weekly downloads. As such, @alwatr/local-storage popularity was classified as not popular.
We found that @alwatr/local-storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.